import { lazy,Suspense } from "react";
import Loading from "@/components/Loading";

const Login = lazy(()=>import('@/pages/Login'))
const Home = lazy(()=>import('@/pages/Home'))

const load = (Comp) => {
  return (
    <Suspense fallback={<Loading />}>
      {Comp}
    </Suspense>
  );
};

export default [
  {
    path:'/login',
    element:<Login />
  },
  {
    path:"/home",
     /* 
      如果某个组件已经被HOC进行劫持渲染了,则一般withxxx的HOC中 都会直接暴露出一个组件,所以我们不需要在这里书写标签结构了
    */
    element:load(Home)
  }
]